package org.zhouhe.web.tag.function;

public class BtnAddFunction {
	private String funName;
	private String winId;
	private String title;
	private String url;
	
	public BtnAddFunction(String funName, String winId, String title, String url){
		this.funName = funName;
		this.winId = winId;
		this.title = title;
		this.url = url;
	}
	
	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("\r\n  function "+ funName +"(){");
		sb.append("\r\n    $($('#"+ winId +"')).dialog('open').dialog('setTitle','"+ title +"');");
		sb.append("\r\n	   $('#"+ winId +"').dialog('resize',{});");
		sb.append("\r\n    $('#"+ winId +"').find('form').form('clear');");
		sb.append("\r\n    $('#"+ winId +"').data('url', '"+ url +"');");
		sb.append("\r\n  }");
		return sb.toString();
	}
}
